/*/*
 * 
 * 
 */

package DigimonAdventure.Things;

import DigimonAdventure.Database.DigimonSpecies;
import DigimonAdventure.Database.Direction;
import DigimonAdventure.DigimonAdventure;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;


/**
 *
 * @author Kris Derril Siregar
 */
public final class DigimonLiarRunnable extends AbstractDigimonLiar implements Runnable{

    private Random rnd;
    public DigimonLiarRunnable (Random rnd,DigimonSpecies species,int str,int vit,int res,int agi){
        super(40 - rnd.nextInt(40),rnd.nextInt(20),species, str, vit, res, agi);
        this.rnd = rnd;
        
    }
	
    public void run() {
        try {
            while(!Thread.interrupted()){
                //synchronized(this){
                    Direction arah = Direction.class.getEnumConstants()[rnd.nextInt(4)];
                    move(arah);
               // }
                Thread.sleep(1000+rnd.nextInt(2000));
            }
        } catch (InterruptedException ex) {
            
        }
    }
    /**
     * Driver
     * @param args
     */
    public static void main (String [] args){
        DigimonLiarRunnable a = new DigimonLiarRunnable(new Random(),DigimonSpecies.Fairymon,5,5,5,5);
        Thread s = new Thread(a);
        s.start();
        while(s.isAlive()){
            System.out.println(a.getX());
            try {
                Thread.sleep(100);
            } catch (InterruptedException ex) {
                Logger.getLogger(DigimonLiarRunnable.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

    }

}
